package org.budo.weixin.message;

import org.budo.support.lang.util.StringUtil;

/**
 * Message
 * 
 * @author li (limingwei@mail.com)
 * @version 1 (2013年12月17日 下午7:45:39)
 */
public class TextMessage extends Message {
    private static final long serialVersionUID = -4560242388181481679L;

    private String content;

    public TextMessage() {
    }

    public TextMessage(String to, String content) {
        this.setTo(to);
        this.setContent(content);
    }

    public String getType() {
        return MessageType.TEXT;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return this.content;
    }

    public String toString() {
        return this.getClass().getName() + "@" + Integer.toHexString(this.hashCode()) //
                + "[id=" + this.getId() //
                + ", type=" + this.getType() //
                + ", from=" + this.getFrom() //
                + ", to=" + this.getTo() //
                + ", createTime=" + this.getCreateTime() //
                + ", content[100]=" + StringUtil.cutLeft(this.getContent(), 100) + "]";
    }
}